package ru.pb.game.network.engine.client.packets.sendable;

import ru.pb.game.network.engine.client.packets.GameServerToClientPacket;
import ru.pb.game.objects.model.players.Player;

public class PROTOCOL_ROOM_GET_LOBBY_USER_LIST_ACK extends GameServerToClientPacket
{
	private Player[] _players;

	public PROTOCOL_ROOM_GET_LOBBY_USER_LIST_ACK(Player[] players)
	{
		_players = players;
	}

	@Override
	public void writeImpl()
	{
		writeH(3603);
		writeD(_players.length);

		for(Player p : _players)
		{
			writeD(1);
			writeD(1);
			writeC(p.getName().length());
			writeS(p.getName());
		}
	}
}